package Chapter9;
import java.awt.*;
import java.awt.event.*;
public class Example06 {
	public static void main(String[] args) {
		final Frame f=new Frame("WindowEvent");
		f.setLayout(new FlowLayout());
		f.setSize(300,200);
		f.setLocation(300, 200);
		f.setVisible(true);
		Button but=new Button("Button");
		f.add(but);
		but.addMouseListener(new MouseListener() {
			public void mouseReleased(MouseEvent e) {
				System.out.println("kaifang");
			}
			public void mousePressed(MouseEvent e) {
				System.out.println("dianji");
			}
			public void mouseExited(MouseEvent e) {
				System.out.println("yichu");
			}
			public void mouseEntered(MouseEvent e) {
				System.out.println("jinru");
			}
			public void mouseClicked(MouseEvent e) {
				System.out.println("wancheng");
			}
		});
	}

}
